package main

import (
	"flag"
	"fmt"
	"time"
)

var (
	name    string
	age     int
	married bool
	delay   time.Duration
)

func main() {

	fmt.Println("hello world")
	flag.StringVar(&name, "name", "张三", "姓名")
	flag.IntVar(&age, "age", 18, "年龄")
	flag.BoolVar(&married, "married", false, "婚否")
	flag.DurationVar(&delay, "delay", 0, "迟到")

	flag.Parse()
	fmt.Println(name, age, married, delay)

	fmt.Println(flag.Args())
	fmt.Println(flag.NArg())
	fmt.Println(flag.NFlag())

}
